As a new cross-language software development platform based on the Internet, .Net was introduced by Microsoft in line with the trends of distributed computing, component oriented and enterprise-level applications, as well as software as a service and web-centered demands in the software industry. Actually, it is not a development language. But a number of development languages are supported for the .Net platform, such as C#, C++, Visual Basic, and Java script.
The compilation of a .Net program is divided into two stages. First, the .Net program in an advanced language is converted to code in an intermediate language (IL). Then, the code in the intermediate language is converted to code in a machine language. Compared to the advanced language, the IL is more similar to the machine language. However, the IL provides some abstract concepts (e.g. classes and exceptions). This is why it is called “intermediate language”.
In the prior art, an executable file of a .Net program is often decompiled into IL code before inserting other IL code (e.g. an encryption/decryption function) into it. Finally, all of the IL code is compiled into a .Net program. This process needs de-compilation and compilation, which is complex and inconvenient. Thus, the efficiency is very low. In addition, the compatibility cannot be ensured. And there are a lot of limits for modifying the .Net program in this way. For example, it is impossible to insert code into the programs compiled by VC.Net, which are based on both the assembly and IL instructions.